home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr49 / vesa18.zip / VESATEST.C < prev    next >
C/C++ Source or Header  |  1993-12-13  |  3KB  |  76 lines

  1. /* VESA package for emx/gcc --- Copyright (c) 1993 by Johannes Martin */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #include "vesa.h"
  6.  
  7. static void print_mode(int mode)
  8. {
  9.   VESAMODEINFO info;
  10.   VESACHAR     c;
  11.  
  12.   printf("-------------------------------------\n");
  13.   if (!VesaGetModeInfo(mode, &info))
  14.     {
  15.       printf("VesaGetModeInfo failed, mode = %i\n", mode);
  16.       return;
  17.     }
  18.   printf("Mode:                 %x\n", mode);
  19.   printf("ModeAttributes:       %x\n", info.ModeAttributes);
  20.   printf("WindowAAttributes:    %x\n", info.WindowAAttributes);
  21.   printf("WindowBAttributes:    %x\n", info.WindowBAttributes);
  22.   printf("WindowGranularity:    %i\n", info.WindowGranularity);
  23.   printf("WindowSize:           %i\n", info.WindowSize);
  24.   printf("WindowAStart:         %p\n", info.WindowAStart);
  25.   printf("WindowBStart:         %p\n", info.WindowBStart);
  26.   printf("BytesPerScanline:     %i\n", info.BytesPerScanline);
  27.   printf("Width:                %i\n", info.Width);
  28.   printf("Height:               %i\n", info.Height);
  29.   printf("CharacterWidth:       %i\n", info.CharacterWidth);
  30.   printf("CharacterHeight:      %i\n", info.CharacterHeight);
  31.   printf("NumberOfMemoryPlanes: %i\n", info.NumberOfMemoryPlanes);
  32.   printf("NumberOfBitsPerPixel: %i\n", info.NumberOfBitsPerPixel);
  33.   printf("NumberOfBanks:        %i\n", info.NumberOfBanks);
  34.   printf("MemoryModelType:      %x\n", info.MemoryModelType);
  35.   printf("SizeOfBank:           %i\n", info.SizeOfBank);
  36.   printf("NumberofPages:        %i\n", info.NumberofPages);
  37.   printf("RedMaskSize:          %i\n", info.RedMaskSize);
  38.   printf("RedMaskPosition:      %i\n", info.RedMaskPosition);
  39.   printf("GreenMaskSize:        %i\n", info.GreenMaskSize);
  40.   printf("GreenMaskPosition:    %i\n", info.GreenMaskPosition);
  41.   printf("BlueMaskSize:         %i\n", info.BlueMaskSize);
  42.   printf("BlueMaskPosition:     %i\n", info.BlueMaskPosition);
  43.   printf("ReservedMaskSize:     %i\n", info.ReservedMaskSize);
  44.   printf("ReservedMaskPosition: %i\n", info.ReservedMaskPosition);
  45.   printf("Weiter...");
  46.   VesaGetCharacter(&c);
  47.   printf("\n");
  48. }
  49.  
  50. void main(void)
  51. {
  52.   VESAINFO info;
  53.   VESAWORD *modes;
  54.  
  55.   if (!VesaInitialize())
  56.     {
  57.       printf("VesaInitialize failed\n");
  58.       return;
  59.     }
  60.   if (!VesaGetInfo(&info))
  61.     {
  62.       printf("VesaGetInfo failed\n");
  63.       return;
  64.     }
  65.   printf("Version: %u.%u\n", info.Version >> 8, info.Version & 0xff);
  66.   printf("OEM    : %s\n", info.OEMName);
  67.   printf("Modes  : ");
  68.   modes = info.Modes;
  69.   while (*modes != 0xffff)
  70.     printf("%04x, ", *modes++);
  71.   printf("\n\n");
  72.   modes = info.Modes;
  73.   while (*modes != 0xffff)
  74.     print_mode(*modes++);
  75. }
  76.